package cn.iocoder.yudao.adminserver.franky.LRU;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @Description: 饿汉式
 * @Author: franky
 * @CreateDate: 2021/4/16 2:09 下午
 * @Version: 1.0
 */
public class SingletonOne {

    private static final SingletonOne instance = new SingletonOne();
    private AtomicLong atomicLong = new AtomicLong(0);
    private SingletonOne(){}

    public static SingletonOne getInstance() {
        return instance;
    }

    public long getId() {
       return atomicLong.incrementAndGet();
    }

}
